package com.itheima.day18.注解.注解Test;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class TestMain {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException {
        Class clazz = Class.forName("com.itheima.day18.注解.注解Test.userTest");
        Method[] ms = clazz.getDeclaredMethods();
        Object obj = clazz.newInstance();
        for (Method d : ms) {
            d.setAccessible(true);
            if (d.isAnnotationPresent(Test.class)) {
                d.invoke(obj);
            }
        }
    }
}
